<template>
    <h2>添加公告类型页面</h2>
    <table border="1">
        <tr>
            <td>公告类型</td>
            <td>
                <input type="text" placeholder="请输入公告类型"v-model="info.lname">
            </td>
        </tr>
        <tr>
            <td></td>
            <td>
                <input type="button" value="添加公告" @click="Add">
            </td>
        </tr>
    </table>
</template>
<script setup lang="ts">
import axios from 'axios';
import { ref } from 'vue';
const info=ref({
    "lid": 0,
    "lname": ""
})
const Add=()=>{
    axios.post("https://localhost:7218/api/Title/AddTitleLei",info.value)
    .then(res=>{
        if(res.data>0){
            alert("标题添加成功");

        }
    })
}
</script>
